<?
$base_url = "";
if($_SERVER['HTTP_HOST'] == "localhost" || $_SERVER['HTTP_HOST'] == "test") {
	$base_url = "http://" . $_SERVER['HTTP_HOST'];
} else {
	$base_url = "http://www.taobaobox.cn/jinxun";
}
?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Expires" CONTENT="0"/>
<meta http-equiv="Cache-Control" CONTENT="no-cache"/>
<meta http-equiv="Pragma" CONTENT="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
</head>
<body bgcolor=white>

<div style="width:100%; background:url(logo_bg_2.jpg)">
<img src="./logo_2.jpg" width=316 height=152>
</div>

<div style="padding:5px">
<label for="text-basic">用户账号:</label>
<input type="text" name="text-basic" id="uid" value="" onfocus="$('#login_tips').hide()">

<label for="password">登录密码:</label>
<input type="password" name="password" id="pwd" value="" autocomplete="off"  onfocus="$('#login_tips').hide()">

<div id="login_tips" style="display:none">
<input type="button" value="对不起，用户验证失败！" data-icon="grid" data-iconpos="right" data-mini="true" data-theme="e">
</div>

<p>
    <a href="#" data-role="button" data-mini="true" data-inline="true" data-icon="check" data-theme="b" onclick="doLogin();return false">确认登录</a>  <a href="#forgetPwd" data-rel="popup" data-role="button" data-mini="true" data-inline="true" data-icon="info" data-theme="d"  data-transition="pop">忘记密码</a>
</p>
</div>

<div data-role="popup" id="forgetPwd">
    <p>请联系96365系统管理员帮您处理，谢谢！</p>
</div>

<div style="text-align:center; border-top:#0d50a1 2px solid; padding-top:10px">&copy; 2013，湖南通信产业服务有限公司 金迅网络分公司</div>
<script>
	function showLoader() {  
		//显示加载器.for jQuery Mobile 1.2.0  
		$.mobile.loading('show', {  
			text: '登录验证中...', //加载器中显示的文字  
			textVisible: true, //是否显示文字  
			theme: 'a',        //加载器主题样式a-e  
			textonly: false,   //是否只显示文字  
			html: ""           //要显示的html内容，如图片等  
		});  
	}  
	  
	//隐藏加载器.for jQuery Mobile 1.2.0  
	function hideLoader()  
	{  
		//隐藏加载器  
		$.mobile.loading('hide');  
	}  

	function doLogin() {
		showLoader()
		var params = {'uid':$('#uid').val(), 'pwd':$('#pwd').val()}
		$.getJSON("<?echo $base_url?>/mobile/check.php?callback=?&action=check", params, function(data){
			hideLoader();
			//alert(data.result)
			if(data.result == "sorry") {
				$("#login_tips").show();
			} else {
				window.location = "list.php";
			}
		});
	}
</script>
</body>
</html>